package com.dk.mapper;

import com.dk.pojo.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2022-07-08
 */
@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
    @Select("select m.id,m.parentid,m.type,m.name,m.start,m.url from menu m inner join menuandpart mp on m.id = mp.menuId\n" +
            "inner join partanduser pu on mp.partId=pu.partId\n" +
            "where pu.userId=#{id} and type <>2 and start=1")
    List<Menu> getPower(Integer id);
    @Select("select m.id from menu m inner join menuandpart mp on m.id = mp.menuId\n" +
            "where mp.partid=#{id}")
    List<Integer> getpartPower(Integer id);



}
